package com.junmo.oauth.module.system.controller;

import com.alibaba.fastjson.JSON;
import com.junmo.oauth.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
@Slf4j
public class TestController {

    @GetMapping
    public R page(){
        log.info("---------------\n"+
                JSON.toJSONString(SecurityContextHolder.getContext().getAuthentication().getPrincipal())
                +"\n--------------------");
        return R.success("你好");
    }
}
